<%@page contentType="text/html;charset=UTF-8"%>
<%@page pageEncoding="UTF-8"%>
<%@ include file="/pub/includ.jsp"%>
<html>
<head>
<script type="text/javascript">

        
      $(document).ready(function(){
      $.formValidator.initConfig({formid:"siteform",alertmessage:false,onerror:function(msg){alert(msg)}});
      $("#site_name").formValidator({empty:"true"}).inputValidator({min:1,max:50,onerror:"站点名称过长，请确认"});
      $("#site_path").formValidator({empty:"true"}).inputValidator({min:1,max:60,onerror:"站点路径过长，请确认"});
      $("#site_url").formValidator({empty:"true"}).inputValidator({min:1,max:60,onerror:"站点访问路径过长，请确认"});
      $("#sitemgrName").formValidator({empty:"true"}).inputValidator({min:1,max:60,onerror:"站点管理员过长，请确认"});
      $("#order_num").formValidator({}).inputValidator({min:1,max:3,onerror:"排序号必须在0-999之间，请确认"}).regexValidator({regexp:"^[0-9]*$",onerror:"排序号错误"});
      $("#remarks").formValidator({empty:"true"}).inputValidator({min:1,max:60,onerror:"备注过长，请确认"}); 
});
		var save = function(){
			var flag = "failure";
			if($.formValidator.pageIsValid()){
			var options = {
				type: 'POST',
				async: false,
				dataType: 'content-type',
				success: function(msg) {
					flag = msg;
				}
			}
			$('#siteform').ajaxSubmit(options);
			}
			return flag;
		}
		
		function selectUser(oId,oName){
			selUser("{oId:\'"+oId+"\',oName:\'"+oName+"\',width:\'500\',height:\'300\',type:\'one\'}",window);
		}
			
		function changesiteurl(){
			$('#site_url').attr('value',$('#site_path').attr('value')+".wingcms.com");
		}
			 
</script>
</head>
<body style="margin:0;height:100%">
<form id="siteform" action="<%=path %>/cms/site/save" method="post" target="_self">
<table><tr><td height="2px"></td></tr></table>
<table align="center" border="0" cellpadding="0" cellspacing="1" class="table_nbw" >
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">站点名称</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" id="site_name" name="site_name" value="${site.site_name}"></td>
	</tr>
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">站点路径</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" onkeyup="changesiteurl()" id="site_path" name="site_path" value="${site.site_path}"></td>
	</tr>
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">站点访问路径</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw" type="text" id="site_url" name="site_url" value="${site.site_url}"></td>
	</tr>
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">站点管理员</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" id="sitemgrName" name="sitemgrName" value="${sitemgrName}">
			<input type="hidden" id="sitemgrId" name="sitemgrId" value="${sitemgrId}">
			<input type="button" onclick="selectUser('sitemgrId','sitemgrName')" value="选择">
		</td>
	</tr>
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">排序号</td>
		<td align="left" style="background-color:fff">&nbsp;<input class="textfiled_nbw"  type="text" id="order_num" name="order_num" value="${site.order_num}"></td>
	</tr>
	<tr >
		<td align="right" width="30%"  style="background-color:fff;height:25px;">备注</td>
		<td align="left" style="background-color:fff">&nbsp;<textarea class="textfiled_nbw" rows="6" cols="35" id="remarks" name="remarks">${site.remarks}</textarea>
		</td>
	</tr>
</table>
<input type="hidden" name="valid_flag" value="${site.valid_flag}"/>
<input type="hidden" name="clone_num" value="${site.clone_num}"/>
<input type="hidden" name="status" value="${site.status}"/>
<input type="hidden" name="id" value="${site.id}"/>
</form>
</body>
</html>


